package name.elftesting.vncelf;

import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;

public class PictureZoom {

	public final BufferedImage getResizePicture(BufferedImage originalPic,
			double bo) {

		int originalImageWidth = originalPic.getWidth();

		int originalImageHeight = originalPic.getHeight();

		int changedImageWidth = (int) (originalImageWidth * bo);

		int changedImageHeight = (int) (originalImageHeight * bo);

		BufferedImage changedImage = new BufferedImage(changedImageWidth,
				changedImageHeight, BufferedImage.TYPE_3BYTE_BGR);

		double widthBo = bo;

		double heightBo = bo;

		AffineTransform transform = new AffineTransform();
		transform.setToScale(widthBo, heightBo);

		AffineTransformOp ato = new AffineTransformOp(transform, null);
		ato.filter(originalPic, changedImage);

		return changedImage;
	}

}
